

all: compile lib/libfuncxyz.so main mv


mv: main 
	mv main bin


compile: src/func1.c src/func2.c include/func1.h include/func2.h
	cd src; gcc -fPIC -o func1.o -c func1.c -I ../include
	cd src; gcc -fPIC -o func2.o -c func2.c -I ../include

lib/libfuncxyz.so: src/func1.o src/func2.o
	gcc -shared -o lib/libfuncxyz.so src/func1.o src/func2.o

main: app.c lib/libfuncxyz.so
	gcc -o main app.c -Llib -l funcxyz -I ./include


clean:
	rm -f src/*.o
	rm -f main
	rm -f lib/*.o
.PHONY:clear compile all mv
